<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-15
    	描述：基地专家
    -->
	<div class="Announcements">
		<div class="Website-visits">
			<div class="location">
				<div class="location-text fl">
					<img class="location-img fl" src="../../images/BaseManager/experts.png" />
					<p class="fr">基地专家</p>
				</div>
				<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
			</div>
			<div class="search-box">
				<div class="fl">
					<select class="search" id="searchSelect">
						<option value="expertName">专家姓名</option>
            <option value="secondLevel">二级学科</option>
            <option value="theWork">身份证</option>
            <option value="phoneNumber">联系方式</option>
					</select>
				</div>
				<div class="fr">
					<input class="search" id="searchRoleVal" type="text" />

					<input class="btn" @click="searchExpert" type="button" autocomplete="off" value="搜索" />
				</div>

			</div>
			<div class="PressRelease-list">
				<table>
					<thead>
						<tr>
              				<th class="w220">项目名称</th>
							<th class="w100">专家姓名</th>
							<th class="w220">身份证</th>
							<th class="w100">二级学科</th>
              <th class="w100">指导次数</th>
							<th class="w100">工作记录</th>
              <th class="w100">联系方式</th>
              <th class="w100">项目动态</th>
              <th class="w150">合同信息</th>
							<th class="w100">通知公告</th>
						</tr>
					</thead>
					<tbody>
					<tr v-if="experts == null || experts.length == 0">
						<td colspan="10">暂无数据！</td>
					</tr>
					<tr v-else v-for="(e,index) in experts" :class="index==curIndex?'activeBg':''" @click="choosed(index)">
						<td :title="e.name"><span class="show-twoline">{{e.name}}</span></td>
						<td>{{e.expert_name}}</td>
						<td>{{e.the_work}}</td>
						<td>{{e.second_level}}</td>
						<td> {{ e.already == 0?'': e.already }} | {{ e.guide == 0?'': e.guide }}</td>
						<td><input @click="rorkRecord(e.id)" type="button" value="查看" class="delete write" /></td>
						<td>{{e.phone_number}}</td>
						<td><input @click="projectDetails(e)" class="delete write" type="button" value="查看 " /></td>

						<td>
							<input v-if="!e.guide" @click="openModal(e.id, e, 1)" type="button" value="填写" class="delete write" />
							<input v-else @click="openModal(e.id, e, 2)" type="button" value="修改" class="delete write" />
							<input v-if="e.guide" @click="modelShowViewThe(e)" type="button" value="查看" class="delete write" />
						</td>

						<td><input @click="demand(e.phone_number)" type="button" value="通知" class="through " /></td>
					</tr>

					</tbody>
				</table>

			</div>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
				<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		</div>
		<!-- 合同信息-模态框-->
		<div v-show="modelShow" class="tenant-model">
			<div class="tenant-model-content modelShow add-model-show">
				<header class="tenant-model-header">
					<h3 v-if="type != 2">填写合同信息</h3>
					<h3 v-if="type == 2">修改合同信息</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box" id="contractForm">
							<div class="after time-style">
								<div class="form-line fl input-required">
									<label>开始时间：</label>
									<div class="input-box">
										<el-date-picker   @change="changeInput()" name="contractBeginTime" v-model="contractBeginTime" type="date" placeholder="选择日期">
										</el-date-picker>
									</div>
								</div>
								<div class="form-line fr input-required">
									<label>结束时间：</label>
									<div class="input-box" >
										<el-date-picker @change="changeInput()"  name="contractEndTime" v-model="contractEndTime" type="date" placeholder="选择日期">
										</el-date-picker>
									</div>
								</div>
							</div>

							<div class="form-line input-required ">
								<label>指导次数：</label>
								<div class="input-box guidance-times">
									<!-- placeholder="请输入指导次数"-->
									<input type="text"    id="guide" name="guide">
								</div>
								<span>次</span>
							</div>

							<div class="search-boxs imgbox">
								<label>附件上传：</label>
								<input name="contract" type="hidden" v-model="contract" />
								<input type="file" id="handIdFront" accept=".doc,.docx,.xls,.xlsx,.pdf,.html,.txt,image/jpeg,image/tif,image/gif,image/png,image/bmp,.mp3,.mp4,.wav,.flv,.avi" @change="idFrontImg($event)" style="display: none;" />
								<a v-if="type !== 3" class="delete write" @click="touchOffIdInput(1)">上传附件</a>
								<a v-if="type !== 3&&FileUpload.length" class="delete write" @click="delAttr()">删除附件</a>
								<!--<a  class="delete write" @click="toSrc(obj.contract)">预览</a>-->
								<ul v-if="type !== 3&&FileUpload.length" class="img-box fileUpload-box">
									<li  v-for="item in FileUpload">{{item.name}}</li>
								</ul>
							</div>

						</form>
					</div>
				</div>
				<footer class="tenant-model-footer">
					<button v-if="type == 1" class="determine" @click="subcontractForm">确定</button>
					<button v-else-if="type == 2" class="determine" @click="subcontractForm">保存</button>
					<button v-else class="determine" @click="closeModel">确定</button>
				</footer>
			</div>
		</div>

    <!-- 合同信息-查看模态框-->
    <div v-if="modelShowView" class="tenant-model">
      <div class="tenant-model-content modelShow look-agreement">
        <header class="tenant-model-header">
          <h3>查看合同信息</h3>
          <span @click="closeModel" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--模态框内容板块-->
            <form class="form-box" >
              <div class="after time-style">
                <div class="form-line fl">
                  <label>开始时间：</label>
                  {{formatData(contractBeginTime)}}
                </div>
                <div class="form-line fr">
                  <label>结束时间：</label>
                  {{formatData(contractEndTime)}}
                </div>
              </div>

              <div class="form-line ">
                <label>指导次数：</label>
                <span>{{obj.guide}}次</span>
              </div>
              <div class="search-boxs imgbox">
                <label>附件上传：</label>
                <a  class="delete write" @click="toSrc(obj.contract)">预览</a>

              </div>

            </form>
          </div>
        </div>

      </div>
    </div>

		<!-- 对接项目具体信息-模态框-->
		<div v-if="ProjectModelShow" class="tenant-model">
			<div class="tenant-model-content demandModel">
				<header class="tenant-model-header">
					<h3>查看项目动态</h3>
					<span @click="closeModels" id="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<div class="tab-tit">
				<!--			<a href="javascript:;" @click="curId=0" :class="{'cur':curId===0}">项目说明书</a>-->
							<a href="javascript:;" @click="curId=1" :class="{'cur':curId===1}">项目立项</a>
							<a href="javascript:;" @click="curId=2" :class="{'cur':curId===2}">项目中期</a>
							<a href="javascript:;" @click="curId=3" :class="{'cur':curId===3}">项目结题</a>
						</div>
						<div class="tab-con">
				<!--			<div v-show="curId===0">
								<div class="rork">
									<p>项目名称：{{projectObj.name}}</p>
									<p>项目类型：{{projectObj.type == 0?'研究院项目':'横向项目'}} </p>
									<p>项目简介：{{projectObj.introduction}}</p>
									<p>附件：<a @click="toSrc(projectObj.demand_book_url)">预览</a>  </p>
								</div>
							</div>-->
							<div v-show="curId===1">
								<p class="rork-text">专家任务书</p>
								<div class="rork">
									<p>项目名称：{{projectObj.name}}</p>
									<p>合同开始时间：{{formatData(projectObj.contract_begin_time)}}</p>
									<p>合同结束时间：{{formatData(projectObj.contract_end_time)}}</p>
                  <p>项目负责人：{{projectObj.expert_name}}</p>
                  <p>身份证号码：{{projectObj.the_work}}</p>
									<p v-if="projectObj.initiation_audit_status == 2">项目总金额：{{projectObj.budget_amount}}</p>
									<p v-if="projectObj.initiation_audit_status == 2">任务书附件：<a @click="toSrc(projectObj.task_book_url)" class="delete write">预览</a> </p>
								</div>
							</div>
							<div v-show="curId===2">
								<p class="rork-text">中期进度报告</p>
								<div class="rork">
									<p>项目名称：{{projectObj.name}}</p>
									<p>合同开始时间：{{formatData(projectObj.contract_begin_time)}}</p>
									<p>合同结束时间：{{formatData(projectObj.contract_end_time)}}</p>
                  <p>项目负责人：{{projectObj.expert_name}}</p>
                  <p>身份证号码：{{projectObj.the_work}}</p>
									<p>项目总金额：{{projectObj.budget_amount}}</p>
									<p  v-if="projectObj.metaphase_audit_status == 2">经费使用金额：{{projectObj.practical_amount}}</p>
									<p  v-if="projectObj.metaphase_audit_status == 2">中期报告附件：<a @click="toSrc(projectObj.metaphase_report_url)" class="delete write">预览</a> </p>
								</div>
							</div>
							<div v-show="curId===3">
								<p class="rork-text">结题报告</p>
								<div class="rork">
									<p>项目名称：{{projectObj.name}}</p>
									<p>合同开始时间：{{formatData(projectObj.contract_begin_time)}}</p>
									<p>合同结束时间：{{formatData(projectObj.contract_end_time)}}</p>
                  <p>项目负责人：{{projectObj.expert_name}}</p>
                  <p>身份证号码：{{projectObj.the_work}}</p>
									<p>项目总金额：{{projectObj.budget_amount}}</p>
									<p v-if="projectObj.closure_audit_status == 2">经费使用金额：{{projectObj.closure_practical_amount}}</p>
									<p v-if="projectObj.closure_audit_status == 2">结题报告附件：<a @click="toSrc(projectObj.closure_material_url)" class="delete write">预览</a> </p>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 通知提醒-模态框-->
		<div v-if="demandModelShow" class="tenant-model">
			<div class="tenant-model-content demandModel">
				<header class="tenant-model-header">
					<h3>填写通知公告</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box">
							<div class="form-line ">
								<label class="textarea-label"><span class="star">*</span>内容：</label>
								<textarea id="smscontent" value="请输入内容" class="input-box textarea-box"></textarea>
							</div>
						</form>

					</div>
				</div>
				<footer class="tenant-model-footer">
					<button class="determine" @click="subDemand">确定</button>
				</footer>
			</div>
		</div>

		<!-- 对接专家团队日志-模态框-->
		<div v-if="WorkModelShow" class="tenant-model">
			<div class="tenant-model-content ">
				<header class="tenant-model-header">
					<h3>查看工作记录</h3>
					<span @click="closeWorkModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain checkbox">
						<!--模态框内容板块-->
						<table>
							<tr>
								<th class="w150">时间</th>
				                <th class="w200">事由</th>
				                <th class="w200">地点</th>
				                <th class="w80">附件</th>
							</tr>
              <tr v-if="logData == null || logData.length == 0">
                <td colspan="4" class="center">暂无数据！</td>
              </tr>
							<tr v-for="l in logData">
								<td>{{formatData(l.beginTime)}}</td>
								<td :title="l.content">
									<span class="show-oneline-table">{{l.content}}</span>
								</td>
								<td :title="l.position">
									<span class="show-oneline-table">{{l.position}}</span>
								</td>
								<td>
									<button  @click="toSrcThe(l.picture)" class="delete write">预览</button>
								</td>
							</tr>
						</table>
						<pageination :total="logTotal" :size="size" :page="logPage" :changge="pageFnExpertsLog" @child="obtainChildExpertsLog"></pageination>

					</div>
				</div>
				<!--	<footer class="tenant-model-footer">
                      <button class="determine">确定</button>
                  </footer>-->
			</div>
		</div>

	</div>
</template>
<script src="./BaseExpert.js"></script>

<style scoped>
	@import "BaseExpert.css";
</style>
